Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: frequency: add support for ADMFM2000 #2416

Merged
merged 3 commits into from
Feb 3, 2025
Merged

drivers: frequency: add support for ADMFM2000 #2416

merged 3 commits into from
Feb 3, 2025

Conversation

ranechita
Copy link
Contributor

The ADMFM2000 is a dual-channel microwave downconverter, with input RF and local oscillator (LO) frequency ranges covering 5 GHz to 32 GHz, with an output intermediate frequency (IF) frequency range from 0.5 GHz to 8 GHz. Added driver and iio_support.

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

@ranechita ranechita requested a review from a team January 16, 2025 14:22
@ranechita ranechita self-assigned this Jan 16, 2025
drivers/frequency/admfm2000/admfm2000.h Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.c Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.c Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.c Outdated Show resolved Hide resolved
@ranechita
Copy link
Contributor Author

v2:

  • dropped code separators
  • switched to 2d array for DSA and switch gpios & init params

@ranechita
Copy link
Contributor Author

v3:

  • shortened param initialization in README

CiprianRegus
CiprianRegus previously approved these changes Jan 23, 2025
@CiprianRegus
Copy link
Contributor

There seems to be an error regarding the documentation:

Missing admfm2000.rst file at doc/sphinx/source/drivers
Missing drivers/admfm2000 link inside doc/sphinx/source/drivers_doc.rst

Copy link
Contributor

@amiclaus amiclaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please split the code in multiple commits: one for driver, one for iio driver, one for documentation. there are multiple recent examples for this.

drivers/frequency/admfm2000/admfm2000.h Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.h Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.h Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.c Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/iio_admfm2000.c Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/iio_admfm2000.h Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.h Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.c Outdated Show resolved Hide resolved


int32_t admfm2000_get_gain(struct admfm2000_dev *dev, uint8_t chan,
int32_t *gain)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you store in the gain variable? doesn't seem to be a gain, rather a raw value after reading gpios.

@ranechita
Copy link
Contributor Author

v4:

  • added doc files
  • changed year
  • moved function comments to .c file

@ranechita ranechita force-pushed the admfm2000_dev branch 3 times, most recently from 14d31d4 to 6d9ecac Compare January 28, 2025 12:26
@ranechita
Copy link
Contributor Author

v5:

  • rebased and solved doc conflict

drivers/frequency/admfm2000/admfm2000.c Outdated Show resolved Hide resolved
drivers/frequency/admfm2000/admfm2000.c Outdated Show resolved Hide resolved
if (!admfm2000_dev)
return -EINVAL;

ret = admfm2000_get_gain(admfm2000_dev, channel->ch_num, &gain);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups, was this tested?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not after the name change, but it's fixed now

The ADMFM2000 is a dual-channel microwave downconverter, with input
RF and local oscillator (LO) frequency ranges covering 5 to 32 GHz,
with an output intermediate frequency (IF) frequency range from
0.5 GHz to 8 GHz. Added no-os driver.

Signed-off-by: Ramona Alexandra Nechita <[email protected]>
Added IIO support for the ADMFM2000 driver.

Signed-off-by: Ramona Alexandra Nechita <[email protected]>
Added README and subsequent doc files for ADMFM2000 driver.

Signed-off-by: Ramona Alexandra Nechita <[email protected]>
@ranechita
Copy link
Contributor Author

v6:

  • fixed function calls after name change set/get_gain -> set/get_dsa_raw

@dbogdan dbogdan merged commit 6f24ff8 into main Feb 3, 2025
11 of 14 checks passed
@dbogdan dbogdan deleted the admfm2000_dev branch February 3, 2025 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants